<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="js/vue.min.js"></script>
<style type="text/css">
.red{color:red;}
.orange{color:orange;}
.yellow{color:yellow;}
</style>
</head>
<body>
<div id="myApp">
<h3>v-watch监听</h3>
<input type="text" v-model="message"><br><br>
{{message}}
<hr>
<h3>实例化的方式进行监听</h3>
<input type="text" v-model="messageData"><br><br>
{{messageData}}
</div>
<script type="text/javascript">
var myApp = new Vue({
	el:"#myApp",
	data:{ 
		message:'赵子龙',
		messageData:'赵云'
	},
	watch:{
		message:function(res){
			console.log(res);
		}
	}
});
myApp.$watch('messageData',function(res){
	console.log(res);
})
</script>
</body>
</html>